package com.erlinyou.im.service.motion.impl;

import java.util.List;
import java.util.Map;
import java.util.Optional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;

import com.erlinyou.base.service.BaseServiceImpl;
import com.erlinyou.im.dao.repository.motion.UserMotionLikeRepository;
import com.erlinyou.im.model.motion.UserMotionLike;
import com.erlinyou.im.model.motion.UserMotionLikeKey;
import com.erlinyou.im.service.motion.UserMotionLikeService;
@Service
public class UserMotionLikeServiceImpl extends BaseServiceImpl<UserMotionLike, UserMotionLikeKey> implements UserMotionLikeService {

	@Autowired
	private UserMotionLikeRepository userMotionLikeRepository;

	@Override
	public <S extends UserMotionLike> S save(S entity) {
		return userMotionLikeRepository.save(entity);
	}

	@Override
	public Optional<UserMotionLike> findById(UserMotionLikeKey id) {
		return userMotionLikeRepository.findById(id);
	}

	@Override
	public void deleteById(UserMotionLikeKey id) {
		userMotionLikeRepository.deleteById(id);
	}

	@Override
	public void delete(UserMotionLike entity) {
		userMotionLikeRepository.delete(entity);
	}

	@Override
	public List<Long> getMotionLikeByZuserid(Long userid, String createDate) {
		return userMotionLikeRepository.getMotionLikeByZuserid(userid,createDate);
	}

	@Override
	public List<Map<String, Object>> countByUserid(String ids,Long createDate) {
		return userMotionLikeRepository.countByUserid(ids,createDate);
	}

	@Override
	public List<UserMotionLike> findByUseridAndCreateDate(Long userid, Long createDate) {
		return userMotionLikeRepository.findByUseridAndCreateDate(userid,createDate);
	}

	@Override
	public List<Map<String, Object>> iSLike(Long userid, Long createDate) {
		return userMotionLikeRepository.iSLike(userid,createDate);
	}

}
